﻿using BW.WMS.Core.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.WMS.Domain.Entities.Product
{
    public class UnitModel:BaseEntity
    {
        /// <summary>
        /// 主单位
        /// </summary>
        [Required]
        public long  UnitTypeId { get; set; }
        /// <summary>
        /// 条码
        /// </summary>
        public string BarCode { get; set; }
        /// <summary>
        /// 辅助单位
        /// </summary>
        [Column(TypeName = "json")]
        public List<string> AuxiliaryUnitList { get; set; }
    }


    public class AuxiliaryUnit
    {
        /// <summary>
        /// 辅助单位
        /// </summary>
        [Required]
        public long UnitTypeId { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        [Required]
        public int Number {  get; set; }
        /// <summary>
        /// 辅助条形码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string AuxiliaryBarCode { get; set; }

    }
}
